hysop.operator.custom module

class hysop.operator.custom.CustomOperator(func, invars=None, outvars=None, extra_args=None, ghosts=None, **kwds)[source]

Bases: ComputationalGraphNodeFrontend

Function should take parameters in the following order:
  1. all input fields

  2. all input parameters

  3. all output fields

  4. all output parameters

Note that discrete fields are passed as arguments to the custom function.

Initialize a ComputationalGraphNodeFrontend

Parameters:
  • implementation (Implementation, optional, defaults to None) – target implementation, should be contained in available_implementations(). If None, implementation will be set to default_implementation().

  • base_kwds (dict, optional, defaults to None) – Base class keywords arguments. If None, an empty dict will be passed.

  • impl_kwds – Keywords arguments that will be passed towards implementation implemention __init__.

implementation

the implementation key

Type:

Implementation

backend

the backend corresponding to implementation

Type:

Backend

impl

the implementation class

Type:

ComputationalGraphNodeGenerator or ComputationalGraphNode

impl_kwds

Keywords arguments that will be passed towards implementation implemention impl.__init__ during a call to _generate.

classmethod default_implementation()[source]

Return the default Implementation, should be compatible with available_implementations.

classmethod implementations()[source]

Should return all implementations as a dictionnary. Keys are Implementation instances and values are either ComputationalGraphNode or ComputationalGraphNodeGenerator.